#!usr/bin/env python
#-*- coding:utf-8 _*-
"""
@author:vonzhe
@file: AbstractNetwork.py
"""
from abc import ABCMeta, abstractmethod


class AbstractNetwork(object, metaclass=ABCMeta):

	@abstractmethod
	def feedforward(self,a):
		'''a is input vector, size = 784*1
		return the output vector, at last, size = 10*1
		'''
		raise NotImplementedError()

	@abstractmethod
	def backprop(self,x,y):
		'''
		x: mini_batch (one training data)
		y: label
		Return a tuple ``(nabla_b, nabla_w)`` representing the
		gradient for the cost function C_x.
        this f will be used in update_mini_batch'''
		raise NotImplementedError()

	@abstractmethod
	def update_mini_batch(self, mini_batch, eta,lmbda,n):
		'''
		update the network's weights and biases. will be used in f SGD.
		minibatch: a list of tuple(x,y)
		eta: learning rate
		'''
		raise NotImplementedError()

	@abstractmethod
	def evaluate(self, test_data):
		raise NotImplementedError()

	@abstractmethod
	def cost_derivative(self, output_activations, y):
		raise NotImplementedError()

	@abstractmethod
	def SGD(self,training_data,epochs,mini_batch_size, eta, test_data=None):
		'''call functions of update_mini_batch, evaluate'''
		raise NotImplementedError()

